﻿<UserControl x:Class="Sora.HelpSystem.UI.WPF.HelpContentSummary"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300" Name="helpContentSummary" xmlns:my="clr-namespace:Sora.HelpSystem.UI.WPF.Converters">
    <UserControl.Resources>
        <my:SummaryChildrenConverter x:Key="SummaryChildrenConverter" />
        <HierarchicalDataTemplate x:Key="ContentTreeTemplate" ItemsSource="{Binding Path=Children, Converter={StaticResource SummaryChildrenConverter}}">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="20"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Image Source="/Sora.HelpSystem.UI.WPF;component/Images/page.png" Stretch="None" />
                <TextBlock Grid.Column="1" Text="{Binding SafePageTitle, Mode=OneWay}"/>
            </Grid>
        </HierarchicalDataTemplate>
    </UserControl.Resources>
    <Grid>
        <TreeView Name="helpSummary" ItemTemplate="{StaticResource ContentTreeTemplate}" ItemsSource="{Binding ElementName=helpContentSummary, Path=DocumentRoot.Children, Converter={StaticResource SummaryChildrenConverter}}" SelectedItemChanged="helpSummary_SelectedItemChanged" BorderThickness="0" Background="{x:Null}" TreeViewItem.Selected="helpSummary_Selected" />
    </Grid>
</UserControl>
